# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=encfs
pkgver=1.9.5
_ver=${pkgver/_/-}
pkgrel=15
pkgdesc="EncFS provides an encrypted filesystem in user-space"
url="https://vgough.github.io/encfs/"
arch="all"
license="GPL-3.0-only"
makedepends="rlog-dev openssl1.1-compat-dev fuse-dev boost-dev
	libtool gettext-dev cmake tinyxml2-dev perl"
subpackages="$pkgname-doc $pkgname-lang $pkgname-libs"
source="$pkgname-$_ver.tar.gz::https://github.com/vgough/encfs/archive/v$_ver.tar.gz"
options="!check" # No test suite

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi

	mkdir build
	cd build

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DUSE_INTERNAL_TINYXML=OFF \
		-DINSTALL_LIBENCFS=ON \
		-DBUILD_SHARED_LIBS=ON \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS
	make
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install
}

libs() {
	license="LGPL-3.0-only"
	default_libs
}

sha512sums="036e08ca9bc13b44742aebdee49bf7029d0c6b7e59cd6dedc9a09da2af99482859f6a79eddf07e3db296edaf45aafc48fe08488840e765682e9b192dd6ae4c46  encfs-1.9.5.tar.gz"
